﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="sistemaAcademicoSalaDeEstudoaulas.List" %>

<%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>
<%@ Register src="~/DynamicData/Content/FilterUserControl.ascx" tagname="DynamicFilter" tagprefix="asp" %>

<%@ Register assembly="Catalyst.Web.DynamicData" namespace="Catalyst.Web.DynamicData" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">


<div class="tamanho">

    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true" />

    <h2>Lista de aulas</h2>

    <asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
                HeaderText="Lista de erros de validação" />
            <asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" />
            
            <%--filtro--%>
            
            <asp:DynamicFilterForm ID="DynamicFilterForm1" runat="server" DataSourceID="GridDataSource">
            <FilterTemplate> Data da aula
                <asp:DynamicFilterControl ID="DynamicFilterControl3" runat="server" DataField="dataAula"
                FilterMode="Contains" /> Professor
                <asp:DynamicFilterControl  runat="server" ID="DynamicFilter" DataField="professor"
                OnSelectedIndexChanged="OnFilterSelectedIndexChanged" /> Aluno
                <asp:DynamicFilterControl  runat="server" ID="DynamicFilterControl1" DataField="aluno"
                OnSelectedIndexChanged="OnFilterSelectedIndexChanged" /> Disciplina
                <asp:DynamicFilterControl  runat="server" ID="DynamicFilterControl2" DataField="disciplina"
                OnSelectedIndexChanged="OnFilterSelectedIndexChanged" />
               
                <asp:Button ID="LinkButton1" runat="server" CommandName="Search" Text="Procurar"></asp:Button><br />
                
            </FilterTemplate>
            </asp:DynamicFilterForm>           
            <br />
            
              <%--fim filtro--%>
              
              
            <asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource"
                AllowPaging="True" AllowSorting="True" CssClass="gridview" 
                AutoGenerateColumns="False" OnRowDataBound="RowDataBound" Width="99%" PageSize="20">
                
                <Columns>  
                             
                            
                    <asp:DynamicField DataField="aluno" HeaderText="Aluno " />
                    <asp:DynamicField DataField="grupo" HeaderText="Grupo " />      
                    <asp:DynamicField DataField="professor" HeaderText="Professor " />              
                    <asp:DynamicField DataField="dataAula" HeaderText="Data" />
                    <asp:DynamicField DataField="horaInicialAula" HeaderText="Hora Inicial " />
                    <asp:DynamicField DataField="horaFinalAula" HeaderText="Hora Final " />
                    <asp:DynamicField DataField="disciplina" HeaderText="Disciplina " />
                    <asp:DynamicField DataField="aulaRealizada" HeaderText="Aula Realizada " />
                    <%--<asp:DynamicField DataField="aulaNaoRealizada" HeaderText="Aulas Não Realizadas " />--%>
                    



                </Columns>

                <PagerStyle CssClass="footer"/>        
                <PagerTemplate>
                    <asp:GridViewPager ID="GridViewPager1" runat="server" />
                </PagerTemplate>
                <EmptyDataTemplate>
                    Não existem aulas cadastradas no sistema.
                </EmptyDataTemplate>
            </asp:GridView>

             <asp:DynamicLinqDataSource ID="GridDataSource" runat="server" ContextTypeName="sistemaAcademicoFinanceiroEscolas.modeloDataContext"
                TableName="aulas" EnableDelete="True">
            </asp:DynamicLinqDataSource>

            <br />

            <div class="bottomhyperlink">
                <%--<asp:HyperLink ID="InsertHyperLink" runat="server"><img runat="server" src="~/DynamicData/Content/Images/plus.gif" alt="Cadastrar novo aluno" />&nbsp;Cadastrar novo aluno</asp:HyperLink>--%>
                <%--<a href="Insert.aspx"><img id="Img1" runat="server" src="~/DynamicData/Content/Images/plus.gif" alt="Cadastrar nova aula" />&nbsp;Cadastrar nova aula</a>--%>
            </div>
            
            <br>
            
            
            
        </ContentTemplate>
    </asp:UpdatePanel>
    
    </div>
    
</asp:Content>
